package com.dwjm.controller;


import com.dwjm.pojo.Dormitory;
import com.dwjm.service.DormitoryService;
import com.dwjm.utlis.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/dormitory")
public class DormitoryController {
    @Autowired
    private DormitoryService dormitoryService;
    //获取宿舍信息
    @GetMapping("/get")
    public Result<Dormitory> getDormitoryById(Integer dormId) {
        System.out.println(dormId);
        Dormitory dormitory = dormitoryService.getDormitory(dormId);
        return Result.success(dormitory);
    }
}
